<?php

/**
 * PDF Invoicing Solution for VirtueMart & Joomla!
 * 
 * @package   VM Invoice
 * @version   2.0.24
 * @author    ARTIO http://www.artio.net
 * @copyright Copyright (C) 2011 ARTIO s.r.o. 
 * @license   GNU/GPLv3 http://www.artio.net/license/gnu-general-public-license
 */

defined('_JEXEC') or die('Restricted access');

class JElementEditor extends JElement
{
    
    var $_name = 'Editor';

    function fetchElement ($name, $value, &$node, $control_name)
    {
        $editor = JFactory::getEditor();
        /* @var $editor JEditor */

        $cols = $node->attributes( 'cols' )>0 ? $node->attributes( 'cols' ) : 1;
        $rows = $node->attributes( 'rows' )>0 ? $node->attributes( 'rows' ) : 1;
        $width = $node->attributes( 'width' )>0 ? $node->attributes( 'width' ) : 800;
        $height = $node->attributes( 'height' )>0 ? $node->attributes( 'height' ) : 500;
        
        $code = $editor->display($control_name . '[' . $name . ']', $value, $width, $height, $cols, $rows);
        return $code;
    }
}
?>